
package cse;

import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;

import com.huaweicloud.saaslanding.install.SaaslandingInstallApplication;
import com.huaweicloud.saaslanding.install.applicationservice.ServiceManageFrameService;
import com.huaweicloud.saaslanding.install.dto.ServiceManageFrameworkDto;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

import jakarta.annotation.Resource;

/**
 * 功能描述
 *
 * @since 2022-03-23
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = SaaslandingInstallApplication.class, webEnvironment = RANDOM_PORT)
public class CseTest {

    @Resource
    private ServiceManageFrameService serviceManageFrameService;

    @Test
    public void createConfig() {
        List<ServiceManageFrameworkDto> serviceManageFrameConfigInfoDtoList =
            serviceManageFrameService.createServiceManageFrameConfigInfoDtoList();

        for (ServiceManageFrameworkDto dto : serviceManageFrameConfigInfoDtoList) {
            serviceManageFrameService.createServiceManageFrameConfig(dto);
        }
    }

    @Test
    public void deleteAllConfig() {
        serviceManageFrameService.deleteAllConfig();
    }
}
